1. Field of the Invention
The present invention generally relates to moving picture decoding, and more particularly to a moving picture decoding apparatus and method for decoding bit stream data of a moving picture encoded by intraframe encoding and interframe encoding.

2. Description of the Prior Art
The MPEG (Moving Picture Experts Group) standard is known as an international standard related to the image compression scheme, the disclosure of which is hereby incorporated by reference. The moving picture encoding/decoding technique consistent with the MPEG standard is one of the essential schemes in the recent multimedia environment. Now, a variety of moving picture encoding/decoding is developed.
The encoding system based on the MPEG standard employs a variable-length code in which the number of bits forming data after encoding is not fixed but varied. That is, the amount of information per picture obtained after encoding is increased or decreased on the basis of the property of picture. With the above in mind, a decoder temporarily stores picture data in a built-in buffer memory after encoding (such picture data is referred to as bit stream) in order to start the decoding process when a given number of pictures (picture planes or sheets) is stored. If the buffer memory overflows or underflows, the decoder will not operate normally. In order to avoid the above problem, it is required to monitor the amount of data which is currently stored in the buffer memory and thus control the amount of the bit stream to be written to the buffer memory and the amount of bit stream to be read therefrom.
The MPEG standard is silent in the method of controlling the buffer memory. Hence, various buffer memory control methods have been proposed.
FIG. 1 is a block diagram of a conventional moving picture decoding apparatus, which is directed to monitoring, per picture, the amount of the bit stream occupying the buffer memory by using a temporary reference. A bit stream input part 12 is located at the front stage of a buffer memory 11, and a video decoder 13 is provided at the rear stage thereof. The bit stream input part 12 includes a PSC (Picture Start Code) detector 16 and a TR (Temporary Reference) detector 17. A controller 14 controls the bit stream input part 12 and the video decoder 13. The controller 14 includes a picture counter 18, which counts the number of pictures (picture planes).
An operation of the apparatus shown in FIG. 1 will be given by referring to FIG. 2.
First, at time t0, the controller 14 issues a bit stream request against the bit stream input part 12 in order to store, in the buffer memory 11, data to be decoded, namely, a bit stream supplied from an external storage medium 15. In response to receipt of the bit stream request, the bit stream input part 12 starts to read the bit stream from the external storage medium 15. The bit stream input part 12 extracts a picture start code PSC and a temporary reference TR while reading the bit stream from the external storage medium 15. The picture start code PSC indicates the beginning of the picture layer. According to the MPEG standard, the moving picture data has a hierarchal structure consisting of six layers. Besides the picture layer, the moving picture data has the block layer, macro block layer, slice layer a GOP (Group Of Picture) layer, and sequence layer. The temporary reference TR is a display sequence number assigned to each picture, and is reset at the beginning of the GOP.
FIG. 3 is a diagram showing the concept of the GOP and the temporary reference TR. Each of the GOPs includes a plurality of pictures. For the sake of simplicity, FIG. 3 shows each GOP includes four pictures. The temporary reference TR is a serial number which is assigned to each GOP and starts from xe2x80x9c0xe2x80x9d. The MPEG standard defines an I picture (Intra picture), a P picture (Predictive picture) and a B picture (Bidirectionally predictive picture). Each picture is one of the I, P and B pictures. A GOP header is inserted at the beginning portion of each GOP, and includes a group start code.
It will be noted that the structure shown in FIG. 3 is a frame structure (non-interlace). A field structure (interlace) is known in which one frame consists of an odd field and an even field to which fields an identical temporary reference is assigned.
If the value of the temporary reference TR differs from that of the temporary reference assigned to the immediately prior picture, the bit stream input part 12 informs the controller 14 of detection of picture (time t1 shown in FIG. 2). Then, the bit stream input part 12 writes pictures into the buffer memory 11.
When the controller 14 is informed of the detection of picture, it counts up an internal picture counter 18 (time t1). In the example shown in FIG. 2, the count value is changed from xe2x80x9c0xe2x80x9d to xe2x80x9c1xe2x80x9d. Subsequently, the controller 14 issues the bit stream request until the picture counter becomes equal to xe2x80x9c2xe2x80x9d.
When the picture counter becomes equal to xe2x80x9c2xe2x80x9d, the controller 14 determines that data to be decoded is available in the buffer memory 11, and stops issuing the bit stream request. Then, the controller 14 issues a decode start instruction (time t2). The video decoder 13, which is in the standby state, receives the decode start instruction, and starts decoding in synchronism with a vertical synchronizing signal VSYNC. At that time, the video decoder 13 sends a picture consumption notification to the controller 14.
In response to receipt of the picture consumption notification, the controller 14 counts down the picture counter 18. In the example shown in FIG. 2, the count value is changed from xe2x80x9c2xe2x80x9d to xe2x80x9c1xe2x80x9d. When the picture counter 18 becomes equal to xe2x80x9c1xe2x80x9d, the controller 14 issues the bit stream request again (time t3).
The above sequence is repeatedly carried out during the decode process, the controller 14 issues the bit stream request against the bit stream input part 12 and issues the decode start instruction against the video decoder 13 so that the count value of the picture counter 18 is always xe2x80x9c2xe2x80x9d.
The above sequence does not cause any problem in the normal decoding. However, a problem occurs in a decoding other than the normal decoding, such as a quick decoding.
Let us consider a case where only I pictures are decoded in the quick decoding. The bit stream input part 12 discards the P and B pictures and picks up only the I pictures. The above selecting operation refers to the value of a PCT (Picture Code Type), which will be described later with reference to FIG. 5. The PCT indicates whether the encoded data is obtained by using the intraframe encoding or the interface encoding. The I picture (intraframe encoding) is indicated when PCT=1. The P and B pictures are respectively indicated when the PCT is equal to 2 and 3, respectively.
If there is a bit stream in which a group includes only one I picture, the bit stream input part 12 cannot issue the picture detection notification. This is because the value of the temporary reference TR is reset by the I picture located at the beginning of the group and is always equal to xe2x80x9c0xe2x80x9d. Hence, the bit stream input part 12 does not detect a change of the value of the temporary reference TR. Hence, the bit stream input part 12 does not decode a picture to be decoded, and writes the corresponding bit stream into the buffer memory 11. Hence, the quick decoding does not function.
It is a general object of the present invention to provide a moving picture decoding apparatus and method in which the above disadvantages are eliminated.
A more specific object of the present invention is to provide a moving picture decoding apparatus and method capable of quick-decoding any bit stream.
The above objects of the present invention are achieved by a moving picture decoding apparatus comprising: an input part which provides a picture tag to a bit stream which has been subjected to intraframe or interface encoding, the picture tag having a value monotonously changing on a picture base; a buffer memory storing the bit stream; and a controller controlling a number of pictures stored in the buffer memory by referring to the picture tag.
The above moving picture decoding apparatus may be configured so that the controller refers to the picture tag of a picture written into the buffer memory and the picture tag of a picture read therefrom.
The moving picture decoding apparatus may be configured so that the controller controls the number of pictures on the basis of a difference between the picture tag of a picture written into the buffer memory and the picture tag of a picture read therefrom.
The moving picture decoding apparatus may be configured so that the controller controls the number of pictures so that a difference between the picture tag of a picture written into the buffer memory and the picture tag of a picture read therefrom is equal to or less than a threshold value.
The moving picture decoding apparatus may be configured so that the controller requests the input part to output the bit stream when the difference is less than the threshold value.
The moving picture decoding apparatus may be configured so that the controller allows a read operation of the buffer memory when the difference is equal to the threshold value.
The moving picture decoding apparatus may be configured so that the picture tag has a value which monotonously increases on the picture base.
The moving picture decoding apparatus may be configured so that the input part inserts the pictured tag into the bit stream.
The moving picture decoding apparatus may be configured so that the input part overwrites the picture tag onto a given field of the bit stream.
The moving picture decoding apparatus may be configured so that the given field of the bit stream corresponds to a temporary reference in the MPEG standard.
The moving picture decoding apparatus may further comprise a video decoder which decodes the bit stream read from the buffer memory.
The moving picture decoding apparatus may be configured so that the bit stream is consistent with the MPEG standard.
The moving picture decoding apparatus may be configured so that: the bit stream is consistent with the MPEG standard which defines a temporary reference; and the picture tag has a value only when a value of the temporary reference changes.
The above objects of the present invention are also achieved by a moving picture decoding method comprising the steps of: (a) providing a picture tag to a bit stream which has been subjected to intraframe or interface encoding, the picture tag having a value monotonously changing on a picture base; (b) storing the bit stream in a buffer memory; and (c) a number of pictures stored in the buffer memory by referring to the picture tag.
The moving picture decoding method may be configured so that the step (c) comprises the step of referring to the picture tag of a picture written into the buffer memory and the picture tag of a picture read therefrom.